<!DOCTYPE html>
<html xmlns:layout="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
	layout:decorate="~{common/layout}">

<head>
	<meta charset="UTF-8">
	<title>结果管理</title>
	<style>
	 
	</style>
</head>

<body>
	<div layout:fragment="fragment_body">
		<div class="toolbar">
			<div style="margin-right: 12px; width: 220px;">
				<el-input placeholder="请输入项目名称"></el-input>
			</div>
		</div>
		<div v-loading="listLoading">
			<el-empty description="暂无结果" v-if="list == null || list.length == 0"></el-empty>
			<el-table :data="list" v-if="list !== null && list.length > 0" border style="width: 100%;margin-top: 12px;">
				<el-table-column prop="projectName" label="来源项目" rowspan="2"></el-table-column>
				<el-table-column prop="flowName" label="所属训练流"></el-table-column>
				<el-table-column prop="resultType" label="结果类型"
				:filters="[
			        { text: '规则', value: 'GUI' },
			        { text: '模型', value: 'MODEL' },
			        { text: '表', value: 'TABLE' },
			        { text: '报告', value: 'REPORT' },
			      ]"
			      :filter-method="filterTag"
			      filter-placement="bottom-end"
				>
				<template #default="scope">
			        {{ scope.row.resultType }}
			      </template>
				</el-table-column>
				<el-table-column prop="resultTaskId" label="所属任务"></el-table-column>
				<el-table-column prop="resultGraphCode" label="所属节点"></el-table-column>
				<el-table-column prop="resultDomaindataId" label="数据对象ID"></el-table-column>
				<el-table-column prop="resultCreate" label="生成时间" width="150"></el-table-column>
				<el-table-column prop="resultId" label="操作" width="150">
					<template #default="scope">
						<el-button type="text" size="small" @click="delNode(scope.row.routeId)">查看</el-button>
						<el-button type="text" size="small" @click="delNode(scope.row.routeId)">下载</el-button>
					</template>
				</el-table-column>
			</el-table>
		</div>
	</div>
</body>
<script type="text/javascript" layout:fragment="fragment_script">
	const _data = {
		list: [],
		listLoading: false,
	}
	const _method = {
		filterTag(value, row){
			return row.resultType === value
		},
		filterHandler(value, row, column){
			const property = column['property']
  			return row[property] === value
		},
		loadResults() {
			let that = this
			that.listLoading = true
			getRequst('/jobResult/list').then(function (resp) {
				that.list = resp.data
				that.listLoading = false
			})
		},
	}
	function _created() {
		this.loadResults()
	}
	const _watch = {
		
	}
</script>

</html>